import axios from 'axios'
import recsteelInterface from './recsteelInterface'

const api = {
  // 登陆
  login: (data) => {
    return recsteelInterface('/member/n/login/admin', data, 'POST')
  },
  // 基地单详情
  baseOrderDetail: (data) => {
    return recsteelInterface('/base/p/queryBaseOrder/show', data, 'POST')
  },
  // 基地单列表
  baseOrderList: (data) => {
    return recsteelInterface('/base/p/queryBaseOrders', data, 'POST')
  },
  // 值集列表
  codeList: (params) => {
    return recsteelInterface('/basic/p/codeList', params, 'post')
  },
  // 订单收付款款标记
  updateBaseOrderMarker: (params) => {
    return recsteelInterface('/base/p/markerBaseOrder', params, 'patch')
  },
  // 根据id 身份证 查询供应商
  cusproviderRecognizeSearch: (params) => {
    return recsteelInterface('/mdata/p/cusproviderRecognize/search', params, 'post')
  },
  // 客商关联的基地单
  cusBaseOrders: (params) => {
    return recsteelInterface('/base/p/cusBaseOrders', params, 'post')
  },
  // 散户的基地单
  retailBaseOrders: (params) => {
    return recsteelInterface('/base/p/queryRetailBaseOrders', params, 'post')
  },
  // 入库过磅
  weightInBaseOrderYtj: (params) => {
    return recsteelInterface('/base/p/weightInBaseOrderYtj', params, 'post')
  },
  // 出库过磅
  weightOutBaseOrderYtj: (params) => {
    return recsteelInterface('/base/p/weightOutBaseOrderYtj', params, 'post')
  },
  // 阿里云oss签名
  getAliOssSignature: () => {
    return recsteelInterface('/basic/p/queryOssSignature', {}, 'post')
  },
  // 基地物料
  baseMaterialList: (params) => {
    return recsteelInterface('/mdata/p/baseMaterialList', params, 'post')
  },
  // 仓库列表
  warehouseList: (params) => {
    return recsteelInterface('/sto/p/warehouse/search', params, 'post')
  },
  // 系统设置
  systemConfig: (params) => {
    return recsteelInterface('/basic/p/companyConfigList', params, 'post')
  },
  // 版本信息获取
  getLatestAndroidVersion: () =>
    axios.get(import.meta.env.VITE_FILE_DOMAIN + 'android/output-metadata.json'),
  // 基地单统计
  baseOrderStatistics: (params) => recsteelInterface('/base/p/baseOrderStatistics', params, 'post'),
  // 查询客商
  cusSearch: (params) => recsteelInterface('/mdata/p/cusproviderList', params, 'post'),
  // 客商详情
  cusDetail: (params) => recsteelInterface('/mdata/p/cusproviderList/show', params, 'post'),
  // ocr识别车牌号
  ocrCarNumber: (params) => recsteelInterface('/mdata/p/recognizeCarNumber', params, 'post'),
  // 客商列表
  cusList: (params) => recsteelInterface('/mdata/p/cusproviderList', params, 'post'),
  // 新增客商
  cusAdd: (params) => recsteelInterface('/mdata/p/saveCusprovider', params, 'post'),
  // 客商关联ic卡
  cusRealeatedCard: (params) =>
    recsteelInterface('/mdata/p/cusproviderRelateIcCard', params, 'post'),
  // 根据ic卡查询基地单
  carNumberToOrderId: (params) =>
    recsteelInterface('/base/p/queryBaseOrderByNumber', params, 'post')
}
export default api
